package cn.qiao.rabbitmq.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



/**
 * desc:
 *
 * @author qiao
 * @date 2023年01月05日 15:53
 */
@Configuration
public class FanoutRabbitConfig {

    @Bean
    public Queue QueueA() {
        return new Queue("queue_a", true);
    }

    @Bean
    public Queue QueueB() {
        return new Queue("queue_b", true);
    }

    @Bean
    public Queue QueueC() {
        return new Queue("queue_c", true);
    }

    @Bean
    public FanoutExchange fanoutExchange() {
        return new FanoutExchange("FanoutExchange");
    }

    @Bean
    public Binding bindingFanoutExchangeA() {
        return BindingBuilder.bind(QueueA()).to(fanoutExchange());
    }

    @Bean
    public Binding bindingFanoutExchangeB() {
        return BindingBuilder.bind(QueueB()).to(fanoutExchange());
    }

    @Bean
    public Binding bindingFanoutExchangeC() {
        return BindingBuilder.bind(QueueC()).to(fanoutExchange());
    }


}
